package zhujie.zhujieridisrepostry;

import com.example.demo.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;
import zhujie.redisdao.Redisdao;

import java.util.List;

/**
 * Created by DELL on 2018/12/28.
 */
@Component
public class RedisPostry {
    @Autowired
    private Redisdao redisdao;

    @Cacheable(name="",key="userall")
    public List<User> queryall(){
      return   redisdao.queryall();
    }
    @
    public User querybyid(Integer id) {
        return   redisdao.querybyid(id);
    }
    @CachePut(name="",key="updateuser")
    public User updateUser(User user ) {
        return   redisdao.update(user);
    }

}
